home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14668 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  55 lines

  1. Newsgroups: comp.object,comp.lang.c++,comp.lang.java
  2. Path: newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
  3. From: shang@corp.mot.com (David L. Shang)
  4. Subject: Re: Java: What's the Big Deal?
  5. Reply-To: shang@corp.mot.com
  6. Organization: MOTOROLA 
  7. Date: Mon, 1 Apr 1996 16:19:51 GMT
  8. Message-ID: <1996Apr1.161951.13666@schbbs.mot.com>
  9. References: <1996Apr1.155416.12816@schbbs.mot.com>
  10. Sender: news@schbbs.mot.com (SCHBBS News Account)
  11. Nntp-Posting-Host: 129.188.128.126
  12.  
  13. In article <1996Apr1.155416.12816@schbbs.mot.com> shang@corp.mot.com (David L.  
  14. Shang) writes:
  15. > GC is not always required. For example:
  16. >     class point
  17. >     {
  18. >        public:
  19. >         float x;
  20. >         float y;
  21. >         float z;
  22. >     };
  23. >     class FaceSet
  24. >     {
  25. >         point[] coordIndex;
  26. >         ...
  27. >        public:        
  28. >         loadCoordIndex (char* file_name)
  29. >         {
  30. >             one million of points read here, and
  31. >             coordIndex is created as an array of
  32. >             a million of points.
  33. >         };
  34. >     };
  35.  
  36. I am not saying that GC is not always required. In this case,
  37. coordIndex should be a smart reference, while the element of
  38. the array should be a variable by VALUE.
  39.  
  40. A by-value variable is as clever as a smart reference, or even
  41. smarter in terms of its economy. Sometimes, though, it cannot keep
  42. the exact type of the object, which is not always required, as
  43. in this example.
  44.  
  45. I am not saying Java's array is useless. It is useful in
  46. situitions where herterogeneous collections are required.
  47.  
  48. But a language should let uers have choices.
  49.  
  50. David Shang
  51.  
  52.  
  53.  
  54.